﻿using System;

namespace TestingConcurrencyBenchmark.Problems.ProducerConsumer
{
    class ProducerConsumerWithDataRace : AbstractProducerConsumer
    {   
        public override void Consume()
        {
            Items.WaitOne();
            Buffer.Dequeue().Invoke();
        }

        public override void Produce(Action action)
        {
            Buffer.Enqueue(action);
            Items.Release();
        }
    }
}
